<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="../themes/default/default.css" />
<link rel="stylesheet" href="../plugins/code/prettify.css" />

<style type="text/css">

   body{
     width:800px;
   }
</style>

	<script charset="utf-8" src="../kindeditor.js"></script>
	<script charset="utf-8" src="../lang/zh_CN.js"></script>
	<script charset="utf-8" src="../plugins/code/prettify.js"></script>
	<script>
		var editor1 ;
		KindEditor.ready(function(K) {
				editor1 = K.create('textarea[name="content1"]', {
				cssPath : '../plugins/code/prettify.css',
				uploadJson : '../jsp/upload_json.jsp',
				fileManagerJson : '../jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
		function sub(){
			debugger;
			editor1.sync();
			var text = document.getElementById("acontent2").value;
			console.log(text);
			alert(text);
		
		}
	</script>

</head>
<body>
	<h1 class="stu_title">增加信息</h1>
	<div class="add_stu">
		<form  action="addstu_result.jsp" method="post">
			<table>
				<tr>
					<td>标题：</td>
					<td><input type="text" name="title" /></td>
				</tr>
				
				<tr>
					<td>发文日期：</td>
					<td><input type="date" name="birth" /></td>
				</tr>
				
				<tr>
					<td>备注：</td>
					<td><textarea name="otherinfo" rows="5" cols="40"></textarea></td>
				</tr>
<%=htmlData%>
<form name="example" method="post" action="<%=path %>/Servlet?flag=editor">
	<textarea name="content1" id="acontent2" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;">
			<%-- <%=htmlspecialchars(htmlData)%> --%>
		</textarea>
	<br />
	<input type="button" name="button" value="提交内容" onclick="sub()" /> (提交快捷键: Ctrl + Enter)
</form>
				
				<tr>
				   <td></td>
				   <td><input type="submit" value="提交"></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>

<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>